/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code;

import com.baidu.bjf.remoting.protobuf.EnumReadable;

/**
 *
 * @author CHengJILI
 */
public enum Market  implements EnumReadable {
    ZJ(3) { public String getCode() {return "F";} public String getName() {return "中金"; }public String getFullName() {return "中国金融交易所"; }},
    SC(4) { public String getCode() {return "C";} public String getName() {return "上期"; }public String getFullName() {return "上海期货交易所"; }},
    SH(1) { public String getCode() {return "S";} public String getName() {return "上证"; }public String getFullName() {return "上海证券交易所"; }},
    SZ(2) { public String getCode() {return "A";} public String getName() {return "深证"; }public String getFullName() {return "深圳证券交易所"; }},
    DC(4) { public String getCode() {return "D";} public String getName() {return "大商"; }public String getFullName() {return "大连商品交易所"; }},
    ZC(6) { public String getCode() {return "Z";} public String getName() {return "郑商"; }public String getFullName() {return "郑州商品交易所"; }},
    UNNAME(10) { public String getCode() {return "U";} public String getName() {return "未知"; }public String getFullName() {return "未知的交易所"; }},
    HK(7) { public String getCode() {return "H";} public String getName() {return "港交"; }public String getFullName() {return "香港联合交易苏"; }};

    public abstract String getName();
    public abstract String getFullName();
    public abstract String getCode();
    private final int value;
    Market(int value) { this.value = value; }
    public static Market DeCode(String code) { 
        switch (code){
            case "S":{return Market.SH;}
            case "A":{return Market.SZ;}
            case "F":{return Market.ZJ;}
            case "C":{return Market.SC;}
            case "D":{return Market.DC;}
            case "Z":{return Market.ZC;}
            case "H":{return Market.HK;}
            default:{return Market.UNNAME;}
        }
    }
    public int value() { return this.value; }
}
